package ru.yelbota.flex.as3jobs.libs {
import flash.events.Event;
import flash.events.IEventDispatcher;
import flash.net.URLRequest;
import flash.utils.ByteArray;

/**
 * Common library. Wraps another job libraries.
 */
public class J {

    public static function loadBytes(request:URLRequest):ByteArray {
        return JobUrlLoader.loadBytes(request);
    }

    public static function loadText(request:URLRequest):String {
        return JobUrlLoader.loadText(request);
    }

    public static function loadVariables(request:URLRequest):Object {
        return JobUrlLoader.loadVariables(request);
    }

    public static function waitForEvent(dispatcher:IEventDispatcher, event:String):Event {
        return EventWaiter.waitForEvent(dispatcher, event);
    }

    public static function waitComplete(dispatcher:IEventDispatcher):Event {
        return EventWaiter.waitForComplete(dispatcher);
    }

    public static function saveState(thisObject:Object, f:Function, ...args:Array):* {
        return SideEffectUtils.saveState(thisObject, f, args);
    }
}

}